<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@include file="/inner/head.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
<script>
	function del(id){
  		var url="${basepath}/userinfo?m=del&id="+id;
		jConfirm("确认要执行操作吗？",null,function(r) {
			if(r) {
				$.ajax({
		        	type: "POST",
		        	url: url,
		        	dataType: "json",
		        	success: function(data){
						jSuccess("删除成功!", null, function(r){
							top.main.location.href="${basepath}/userinfo?m=search";
		        		})
		        	},
		        	error: function(data){
		        	}
		    	});
			}
		});
	}
	
	function batchdel(){
		var id=selectSome("chkName");
  		if(!id){
			return;
		}
  		var url="${basepath}/userinfo?m=del&id="+id;
		jConfirm("确认要执行操作吗？",null,function(r) {
			if(r) {
				$.ajax({
		        	type: "POST",
		        	url: url,
		        	dataType: "json",
		        	success: function(data){
						jSuccess("删除成功!", null, function(r){
							top.main.location.href="${basepath}/userinfo?m=search";
		        		})
		        	},
		        	error: function(data){
		        	}
		    	});
			}
		});
	}
	
	function update(){
		var id=selectOne("chkName");
  		if(!id){
			return;
		}
  		var url="${basepath}/userinfo?m=findById&_url=inner/admin/userinfo/update.jsp&id="+id;
		window.location.href=url;
	}
</script>
</head>
<body>
  <form action="${basepath}/userinfo?m=search" method="post" id="userinfoform" name="userinfoform">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
  	<tr>
      <td height="30">
      	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      	  <tr>
        	<td height="24" bgcolor="#353c44">
        	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
          	    <tr>
            	  <td>
            	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
              		  <tr>
                	    <td width="6%" height="19" valign="bottom"><div align="center"><img src="${basepath}/res/image/tb.gif" width="14" height="14" /></div></td>
                	    <td width="94%" valign="bottom"><span class="STYLE1"> 用户基本信息列表</span></td>
              		  </tr>
            	    </table>
            	  </td>
            	  <td>
            	    <div align="right"><span class="STYLE1">
            	      <input name="username" id="username" value="${param.username}" style="height: 14px;vertical-align: middle;"> <img src="${basepath}/res/image/search.jpg" width="39" height="20" style="vertical-align: middle;cursor: pointer;" onclick="firstPage();" title="搜索">   &nbsp; 
              	  	  <span style="cursor: pointer;" title="新增用户" onclick="window.location.href='${basepath}/inner/admin/userinfo/add.jsp'"><img src="${basepath}/res/image/album_add.gif" width="18" height="18"/> 添加  </span> &nbsp; 
              		  <span title="删除" style="cursor: pointer;" onclick="batchdel();"><img src="${basepath}/res/image/album_remove.gif" width="18" height="18"/> 删除</span>    &nbsp;&nbsp;
              		  <span title="编辑" style="cursor: pointer;" onclick="update();"><img src="${basepath}/res/image/album_edit.gif" width="18" height="18"/> 编辑   &nbsp;</span>
              		  <span class="STYLE1"> &nbsp;</span>
               	    </div>
              	  </td>
          	    </tr>
        	  </table>
            </td>
      	  </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td>
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
          <tr>
      		<td width="5%" height="20" bgcolor="d3eaef" class="STYLE10"><div align="center"><input type="checkbox" onClick="selectAll(this,'chkName');"/></div></td>
          	<td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">姓名</span></div></td>
          	<td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">用户名</span></div></td>
        	<td width="20%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">联系方式</span></div></td>
       	 	<td width="30%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">基本操作</span></div></td>
      	  </tr>
      	  <c:forEach items="${pagedata.data}" var="data" varStatus="s" >
      	  <tr>
        	<td height="20" bgcolor="#FFFFFF"><div align="center"><input name="chkName" value="${data.id}" type="checkbox"/></div></td>
        	<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><a href="${basepath}/userinfo?m=detail&id=${data.id}" title="查看">${data.name }</a></div></td>
        	<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">${data.username }</div></td>
        	<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">${data.tel }</div></td>
        	<td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE21"><a href="javascript:del(${data.id});" title="删除">删除</a> | <a href="${basepath}/userinfo?m=detail&id=${data.id}" title="查看">查看</a> | <a href="${basepath}/userinfo?m=findById&id=${data.id}&_url=inner/admin/userinfo/update.jsp" title="修改">修改</a></span></div></td>
      	  </tr>
      	  </c:forEach>
  		</table>
  	  </td>
  	</tr>
  	<tr>
      <td height="30">
      	<%@include file="../../page.jsp" %>
   	  </td>
  	</tr>
  </table>
  </form>
</body>

